{include file="../application/admin/view/index/index_base.html" /}
<div class="nav_z clearfix">
			<div class="nav_nav">
			    <ul>
                    <li class="tdd kebi"><a href="{:url('admin/Index/index')}">教师工作量</a></li>
                    {if $Think.session.userInfo.admin==1}<li class="tdd "><a href="{:url('admin/Admin/index')}">领导统计表</a></li>
                    {else /} <li class="tee"></li>{/if}
			    </ul>
				<ul>
					<li class="tj"><a href="#"><span class="glyphicon glyphicon-home"></span>首页</a></li>
					<li class="tj"><a href="{:url('admin/Index/index')}"><span class="glyphicon glyphicon-list-alt"></span>获奖统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index2')}"><span class="glyphicon glyphicon-list-alt"></span>实训统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index3')}"><span class="glyphicon glyphicon-list-alt"></span>授课统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index4')}"><span class="glyphicon glyphicon-list-alt"></span>科研项目统计</a></li>
					<li class="xuanz tj"><a href="{:url('admin/Index/index5')}"><span class="glyphicon glyphicon-list-alt"></span>论文发表统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index6')}"><span class="glyphicon glyphicon-list-alt"></span>培训(出差)统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index7')}"><span class="glyphicon glyphicon-list-alt"></span>我的数据统计</a></li>
					
				</ul>
			</div>
		</div>
		<div class="nav_z_cont">
			<!-- 论文发表统计表 -->
			<div class="yc">
				<div class="ss clearfix">
					<form class="xzxueqi form-search" action="{:url('admin/Index/lunw_search')}" method="get" >
					<select name="term_id" id="xueqi">
						{volist name="tList" id="t"}
							<option value="{$t['id']}">{$t['term']}</option>
						{/volist}
					    <option selected>选择学期</option>
					</select>
					<input type="text" value="" name="search" id="search" placeholder="搜索内容...">
					<button id="xqxl" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
				</form>
				</div>
					<table>
						<tr class="tr1">
							<td colspan="4" style="text-align: left;">论文发表统计表</td>
							<td colspan="5" style="text-align: right;">
								<button id="xinz"><span class="glyphicon glyphicon-plus"></span>新增</button>
							</td>
						</tr>
						<tr>
							<td>教师</td>
							<td>学期</td>
							<td>论文题目</td>
							<td>刊物名称</td>
							<td>发表期号</td>
							<td>排名顺序</td>
							<td>等级</td>
							<td>状态</td>
							<td>操作</td>
						</tr>
						{volist name="paperList" id="vo" empty="$empty"}
							<tr>
								{assign name="var" value="$i" /}
								<td>{$vo['username']}</td>
								<td>{$vo['term']}</td>
								<td class="hidde">{$vo['title']}</td>
								<td>{$vo['journal_name']}</td>
								<td>{$vo['publish']}</td>
								<td>{$vo['ranking_order']}</td>
								<td>{$vo['grade']}</td>
								{if condition="$vo['state']==1"}
									<td class="zhuangt">审核中</td>
									<td class="caoz">
										<button type="button" class="btn tijiao" disabled="disabled">提交</button>
										<button type="button" class="bianj btn bianji" disabled="disabled">编辑</button>
										<button type="button" class="btn shanchu" disabled="disabled">删除</button>
									</td>
								{elseif condition="$vo['state']==2"/}
									<td class="yish">已审核</td>
									<td class="caoz">
										<button type="button" class="btn tijiao" disabled="disabled">提交</button>
										<button type="button" class="bianj btn bianji" disabled="disabled">编辑</button>
										<button type="button" class="btn shanchu" onclick='if(confirm("确定删除？")){window.location="{:url('admin/Index/lunw_del',['id'=> $vo['id']])}"}'>删除</button>
									</td>
								{elseif condition="$vo['state']==3"/}
									<td class="zhuangt">未通过审核</td>
									<td class="caoz">
										<button type="button" class="btn tijiao" disabled="disabled">提交</button>
										<button type="button" class="bianj btn bianji" onclick="item_edit({$vo['id']})">编辑</button>
										<button type="button" class="btn shanchu" onclick='if(confirm("确定删除？")){window.location="{:url('admin/Index/lunw_del',['id'=> $vo['id']])}"}'>删除</button>
									</td>
								{else condition="$vo['state']==4"/}
									<td class="bc">已保存</td>
									<td class="caoz">
										<button type="button" class="btn tijiao" onclick='if(confirm("确定提交？")){window.location="{:url('admin/Index/lunw_zt',['id'=> $vo['id']])}"}'>提交</button>
										<button type="button" class="bianj btn bianji" onclick="item_edit({$vo['id']})">编辑</button>
										<button type="button" class="btn shanchu" onclick='if(confirm("确定删除？")){window.location="{:url('admin/Index/lunw_del',['id'=> $vo['id']])}"}'>删除</button>
									</td>
								{/if}
							</tr>
						{/volist}
					</table>
					<div class="page">
						{$page}
					</div>
			</div>
		</div>
	</div>
	<!-- 新增窗口 -->
	<div class="box">
	　	<span class="closeBtn glyphicon glyphicon-remove" title="关闭"></span>
		<h2><span class="glyphicon glyphicon-education"></span>新增论文</h2>
		<form action="{:url('admin/Index/lunw_add')}" method="post">
			<input type="hidden" name="user_id" value="{$Think.session.userInfo.id}">
			<input type="hidden" name="state" value="4">
			<p>学期:<select name="term_id">
					{volist name="tList" id="t"}
						<option value="{$t['id']}">{$t['term']}</option>
					{/volist}
				</select>
			</p>
			<p>论文题目:<input type="text" name="title" placeholder="请输入论文题目"></p>
			<p>刊物名称:<input type="text" name="journal_name" placeholder="请输入刊物名称"></p>
			<p>发表期号:<input type="date" name="publish"></p>
			<p>排名顺序:<input type="text" name="ranking_order" placeholder="请输入排名顺序"></p>
			<p>等级:<input type="text" name="grade" placeholder="请说明省区级别+期刊"></p>
			<p><button type="submit">保存</button><button type="reset">重置</button></p>
		</form>
	</div>
	<!-- 编辑窗口 -->
	<div class="bjbox">
	　	<span class="closeBtn glyphicon glyphicon-remove" title="关闭"></span>
		<h2><span class="glyphicon glyphicon-education"></span>编辑获奖项目</h2>
		<form method="post" action="{:url('admin/Index/lunw_save')}">
			<input type="hidden" name="id" id="id">
			<input type="hidden" name="user_id" id="user_id">
			<input type="hidden" name="state" value="4">
			<p>学期:<select name="term_id" id="term_id">
					{volist name="tList" id="t"}
						<option value="{$t['id']}" {if condition="$t['term']==$t['term']"}selected{/if}>{$t['term']}</option>
					{/volist}
				</select>
			</p>
			<p>论文题目:<input type="text" name="title" id="title"></p>
			<p>刊物名称:<input type="text" name="journal_name" id="journal_name"></p>
			<p>发表期号:<input type="date" name="publish" id="publish"></p>
			<p>排名顺序:<input type="text" name="ranking_order" id="ranking_order"></p>
			<p>等级:<input type="text" name="grade" id="grade" "></p>
			<p><button type="submit">保存</button><button type="reset">重置</button></p>
		</form>
	</div>
</body>
<script>
	function item_edit(id){
		var url = "{:url('admin/Index/lunw_find')}";
		$.get(url,{id:id},
			function(data){
				$('#id').val(data.id);
				$('#user_id').val(data.user_id);
				// alert(i);
				$('select#term_id').val(data.term_id);
				$('#title').val(data.title);
				$('#journal_name').val(data.journal_name);
				$('#publish').val(data.publish);
				$('#ranking_order').val(data.ranking_order);
				$('#grade').val(data.grade);
			}				
		);
	}
</script>
</html>